surface: Don't dispose the frame clock prematurely
authorMatthias Clasen <mclasen@redhat.com>
Mon, 20 May 2019 13:19:12 +0000 (13:19 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:16 +0000 (20:25 +0000)
Since we are now sharing frame clocks with multiple
surfaces, we can no longer dispose them unconditionally
when a surface goes away. Only do it if we are a
toplevel (without parent).

This was showing up as criticals on exit when opening
and closing any popover in widget factory.

gdk/gdksurface.c

index ee337c8a2e1f4d27689b379cc1c348e22e3ef2d4..94de885ef26b0526143bb83e5574630ebe43bfdc 100644 (file)
@@ -899,7 +899,8 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
 
   if (surface->frame_clock)
     {
-      g_object_run_dispose (G_OBJECT (surface->frame_clock));
+      if (surface->parent == NULL)
+        g_object_run_dispose (G_OBJECT (surface->frame_clock));
       gdk_surface_set_frame_clock (surface, NULL);
     }